export default function (req, res) {
    const storeCount = 5; // Number of mock stores to generate
  
    const generateMockStore = (index) => {
      const storeId = 20000 + index;
      const unitPrice = [50, 80, 100, 120, 150][Math.floor(Math.random() * 5)];
  
      return {
        id: storeId,
        name: `直属校区${index + 1}`,
        classtimeUnitPrice: unitPrice,
        unusedClasstime: parseFloat((Math.random() * 500 + 50).toFixed(1)),
        unusedStoreCoin: parseFloat((Math.random() * 1000 + 100).toFixed(2)),
      };
    };
  
    const mockData = Array.from({ length: storeCount }, (_, i) => generateMockStore(i));
  
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
            "code": 0,
            "message": "成功！",
            "data": [
                {
                    "id": 20000,
                    "name": "直属校区1",
                    "classtimeUnitPrice": 100,
                    "unusedClasstime": 330.2,
                    "unusedStoreCoin": 684.44
                },
                {
                    "id": 20001,
                    "name": "直属校区2",
                    "classtimeUnitPrice": 120,
                    "unusedClasstime": 270.3,
                    "unusedStoreCoin": 824.52
                },
                {
                    "id": 20002,
                    "name": "直属校区3",
                    "classtimeUnitPrice": 100,
                    "unusedClasstime": 125.6,
                    "unusedStoreCoin": 651.67
                },
                {
                    "id": 20003,
                    "name": "直属校区4",
                    "classtimeUnitPrice": 120,
                    "unusedClasstime": 105.5,
                    "unusedStoreCoin": 374.75
                },
                {
                    "id": 20004,
                    "name": "直属校区5",
                    "classtimeUnitPrice": 150,
                    "unusedClasstime": 219.9,
                    "unusedStoreCoin": 801.97
                }
            ],
            "timestamp": 1762254521972,
            "requestId": "requestId_3ka5idivhdx",
            "signature": "signature_tid7sduflz",
            "isMock": true
        });
      }, 100);
    });
  }